/**
 * Created by zhgk on 2016/9/20 0020.
 */
import {Component, OnInit, ViewChild} from "@angular/core";
import {DtConfig} from "../../../common/dataTable/dt.mode";
import {DataTableComponent} from "../../../common/dataTable/dt.component";
import {baseURL} from "../../../common";


@Component({
    template: require("./worklog.component.html"),

})

export class WorkLogComponent implements OnInit {
    //table表格数据
    dtData: any[] = [];
    dtConf: DtConfig;

    //装入子组件
    @ViewChild(DataTableComponent) viewChild: DataTableComponent;

    ngOnInit(): void {

        this.dtConf = {
            cols: [{
                title: "主键", dataIndex: "ID", hidden: true
            }, {
                title: "名称", dataIndex: "NAME"
            }, {
                title: "编码", dataIndex: "CODE"
            }, {
                title: "路径", dataIndex: "PATH"
            }, {
                title: "状态", dataIndex: "STATUS"
            },
                {
                    title: "顺序", dataIndex: "SEQ"
                }, {
                    title: "类型", dataIndex: "TYPE"
                }
            ],
            pageSize: 3,
            paging: true,
            remote: true,
            url: baseURL + "/bm/sm/menu/child/3"
        }
    }

    clickBtn(): void {
        console.log(this.viewChild.getSelectedRow());
    }
}
